package com.snopy.concurrency.join;

import java.util.concurrent.TimeUnit;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;

/**
 * @author snopy
 * @version 1.0.0
 * @classname DemoJoin2
 * @description
 * @email 77912204@qq.com
 * @date 2022/11/15 16:43
 */
public class DemoJoin2 {
    public static void main(String[] args) {
        Lock LOCK = new ReentrantLock();
        Thread t1 = new Thread(()->{
            System.out.println("t1----");
            try {
                TimeUnit.SECONDS.sleep(3);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
        },"t1");
        Thread t2 = new Thread(()->{
            System.out.println("t2----");
            try {
                TimeUnit.SECONDS.sleep(1);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
        },"t2");
        t1.start();
        t2.start();

    }
}
